package leecode

func sumOfUnique(nums []int) int {
	hashMap := make(map[int]int)
	for i := 0; i < len(nums); i++ {
		hashMap[nums[i]]++
	}
	var sum int
	for num, count := range hashMap {
		if count == 1 {
			sum += num
		}
	}
	return sum
}
